08. CODE: Starting A* Search
Starting A* Search
To get started with writing the A* search algorithm, you will first add a Search
function stub that accepts and returns the appropriate variable types.
To Complete This Exercise:
- Write a
std::vector<vector<State>> Search
function stub which takes a board grid and two length 2 int arrays as arguments. The int arrays will represent the start and goal coordinates for the search. The function should print ""No path found!" and return an emptystd::vector<vector<State>>
. The function will later return the board with a path from the start to the goal.- In
main()
, callSearch
with a start of{0, 0}
and a goal of{4, 5}
. Store the results in the variablesolution
.- Pass
solution
toPrintBoard
.
Workspace
This section contains either a workspace (it can be a Jupyter Notebook workspace or an online code editor work space, etc.) and it cannot be automatically downloaded to be generated here. Please access the classroom with your account and manually download the workspace to your local machine. Note that for some courses, Udacity upload the workspace files onto https://github.com/udacity, so you may be able to download them there.
Workspace Information:
- Default file path:
- Workspace type: generic
- Opened files (when workspace is loaded): n/a
-
userCode:
export CXX=g++-7
export CXXFLAGS=-std=c++17
g++() {
/usr/bin/g++-7 -std=c++17 "$1"
}
export -f g++